﻿using System.Linq;

namespace Sidvall.LogManager.UI.Entities
{
	public class ServerManagerCollection : System.Collections.ObjectModel.ObservableCollection<ServerManager>
	{
		#region IsValid

		public bool IsValid
		{
			get
			{
				foreach (var item in this)
				{
					if (item.IsValid)
						return true;
				}
				return false;
			}
		}

		#endregion
		#region ValidItems

		public System.Collections.Generic.IEnumerable<ServerManager> ValidItems
		{
			get
			{
				return (from o in this
						where o.IsValid == true
						select o);
			}
		}

		#endregion
	}
}
